import { NgModule } from '@angular/core';
import { RouterModule, NavigationEnd, Router } from '@angular/router';
import { LaborCostComponent } from './labor-cost/labor-costcomponent';
import { WorkingHourMonthlyComponent } from './working-hour-monthly/working-hour-monthly.component';
import { InitWorkingHourComponent } from './init-working-hour/init-working-hour.component';
import { InitLaborCostComponent } from './init-labor-cost/init-labor-cost.component';

@NgModule({
    imports: [
        RouterModule.forChild([
            {
                path: '',
                children: [
                    { path: 'labor-cost', component: LaborCostComponent },
                    { path: 'working-hour-monthly', component: WorkingHourMonthlyComponent },
                    { path: 'init-working-hour', component: InitWorkingHourComponent },
                    { path: 'init-labor-cost', component: InitLaborCostComponent }
                ]
            }
        ])
    ],
    exports: [RouterModule]
})
export class HumanResourcesRoutingModule {
    constructor(private router: Router) {
        router.events.subscribe(event => {
            if (event instanceof NavigationEnd) {
                window.scroll(0, 0);
            }
        });
    }
}
